<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"  xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta charset="UTF-8" />
    <title>系统管理</title>
    <link    href="../../plugin/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script  src="../../plugin/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>

    <script src="../../plugin/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
    <script src="../../plugin/ligerUI/json2.js"></script>
    <script src="../../plugin/ligerUI/js/core/init-obj.js" type="text/javascript"></script>
    <script type="text/javascript">
        var navtab = null;
        var companyOibc=null;
        var parentId=null;
        var tree=null;
        var tab = null;
        var accordion = null;
        var tree1 = null;
        var tabItems = [];
        //        <![CDATA[
        $(function ()
        {
            //布局
            $("#layout1").ligerLayout({
                leftWidth: 190,
                height: '100%',
                heightDiff: -34,
                space: 4,
                onHeightChanged: f_heightChanged,
                onLeftToggle: function ()
                {
                    tab&&tab.trigger('sysWidthChange');
                },
                onRightToggle: function ()
                {
                    tab&&tab.trigger('sysWidthChange');
                }
            });






            var height = $(".l-layout-center").height();
            initTabObj("framecenter",height);
            tab=_tabs;

            //面板
            $("#accordion1").ligerAccordion({
                height: height - 24, speed: null
            });

            $(".l-link").hover(function (){

                $(this).addClass("l-link-over");
            }, function ()
            {
                $(this).removeClass("l-link-over");
            });
            tab = liger.get("framecenter");
            accordion = liger.get("accordion1");
            tree = liger.get("tree1");
            $("#pageloading").hide();

            //菜单树
           var id=$("#uerId").val();
            tree1 = $("#menuTree").ligerTree({
                url:'/sec/menu/menuToTree?id='+id,
                ajaxType:'post',
                checkbox: false,
                parentIcon: 'folder',
                childIcon: 'leaf' ,
                slide: false, //是否显示动画
                nodeWidth: 100,
                idFieldName: 'id',
                textFieldName:'menuName' ,
                parentIDFieldName:'parentId',
                onSelect: function (node)
                {
                    //  console.log(node);
                    //navtab.removeAll();
                    // companyOibc=node.data.name;
                    //判断是打开页面 还是tab
                    // parentId = node.data.id;
                    // $('#parentId').val(node.data.id);
                    //判断是打开页面 还是tab
                    if(node.data.openType==1){
                       console.info(tab);
                        f_addTab(node.data.id,node.data.menuName,node.data.url,tab);
                    }else{
                        window.open(node.data.url);
                    }

                    //  doSearch();
                }
            });
           doSearch();

        });

        function f_heightChanged(options)
        {
            if (tab)
                tab.addHeight(options.diff);
            if (accordion&&options.middleHeight - 24 > 0)
                accordion.setHeight(options.middleHeight - 24);
        }
        //        ]]>
    </script>
    <link href="../../plugin/ligerUI/skins/index.css" rel="stylesheet" type="text/css" />

</head>
<body style="padding:0px;background:#EAEEF5;">
<div id="pageloading"></div>
<div id="topmenu" class="l-topmenu">
    <div class="l-topmenu-logo">系统管理</div>
    <div class="l-topmenu-welcome">
        <a href="#" class="l-link2" target="_blank" th:text="${session.userSession.userName}">管理员</a>
        <input type="hidden" th:value="${session.userSessionId}" id="uerId"/>
        <span class="space">|</span>
        <a href="/logout" class="l-link2">注销</a>
    </div>
</div>
<div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; ">
    <div position="left"  title="主要菜单" id="accordion1">
          <!--  <div title="系统管理">
            <div style=" height:7px;"></div>
            <a class="l-link" href="javascript:f_addTab('listpage','菜单管理','/sec/menu/linkList',tab)"><span>+</span>菜单管理</a>
                <div>
                    <a class="l-link" href="javascript:f_addTab('listpage','菜单管理','/sec/menu/linkList',tab)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;菜单管理</a>
                </div>
            <a class="l-link" href="javascript:f_addTab('org-manage','组织管理','view/org-manage.html',tab)">组织管理</a>
            <a class="l-link" href="javascript:f_addTab('user-manage','用户管理','sec/user/linkList',tab)">用户管理</a>
            <a class="l-link" href="javascript:f_addTab('role-mamage','角色权限管理','sec/role/linkList',tab)">角色权限管理</a>
           </div>-->
        <ul id="menuTree"></ul>


       </div>

    <div position="center" id="framecenter">
    </div>

</div>
<div  style="height:32px; line-height:32px; text-align:center;">
    Copyright @ 2017 广州市易度软件开发有限公司
</div>
<div style="display:none"></div>
</body>
</html>